package common;

import java.util.Random;

public class RandomGenerator {
	private static Random rand;
	static{
		rand = new Random();
	}
	public static int getPoissonVariable() {
		double d = rand.nextDouble() * Math.E;
		if(d < 1.0)return 0;
		d -= 1.0;
		for(int i = 1; true; i++){
			d*= i;
			if(d < 1.0){
				return i;
			}
			d -= 1.0;
		}
	}
	
	public static int getInt(int mod){
		return Math.abs(Math.abs(rand.nextInt()) % mod);
	}
	
	public static double getDouble(){
		return rand.nextDouble();
	}

}
